The present invention relates to a controller and a method for writing data.
Usually, peripheral equipment for a computer such as an optical disk drive includes a ROM (read-only memory) as a memory for storing a microcomputer operation program (hereinafter referred to as microcomputer control software) that is used for controlling each circuit. In recent years, usually, an electrically rewritable flash ROM that can rewrite data is used as this ROM. This is because the microcomputer control software must be updated in order to debug the microcomputer control software while the peripheral equipment is being developed or to perform updates (version upgrade) for improving functioning of the microcomputer control software.
Two types of software are written to a flash ROM, one is the aforementioned microcomputer control software for allowing a microcomputer to control each circuit and the other is an update program to be executed by the microcomputer to update the microcomputer control software. During normal operation of peripheral equipment, the microcomputer controls each circuit in accordance with the microcomputer control software written to the flash ROM. In contrast, during update of the microcomputer control software, the microcomputer rewrites the microcomputer control software recorded in the flash ROM in accordance with the update program written to the flash ROM.
The aforementioned description relates to an operation state in which microcomputer control software and an update program have been already written to the flash ROM. In a complete initial state, however, naturally, no data has been written to the flash ROM. That is, to allow a microcomputer to write the microcomputer control software to the flash ROM, at least the update program must have been already written to the flash ROM, but even this program has not been written in a complete initial state.
Consequently, conventionally, predetermined initial data (data containing at least an update program) is written to a flash ROM in a standalone state by commissioning flash ROM manufacturers or by using a ROM writer. A flash ROM chip, to which initial microcomputer control software is written, is subsequently mounted on a printed wiring board of the relevant peripheral equipment by soldering.
In the aforementioned method, because writing of the initial microcomputer control software is needed separately before the flash ROM chip is mounted on the peripheral equipment, the process becomes complicated and manufacturing cost inevitably increases.
Accordingly, Japanese Laid Open Patent publication No. 5-81012 discloses a method that is adopted for mounting a flash ROM chip without writing initial microcomputer control software and writing the microcomputer control software after it is mounted. Specifically, a mask ROM in which at least an update program is recorded in advance is incorporated in the relevant peripheral equipment and this mask ROM is connected to the microcomputer. Subsequently, the microcomputer is operated in accordance with a mask ROM program. The microcomputer writes the microcomputer control software received from a personal computer (PC) via an interface such as an RS232C and an ATAPI or a SCSI to the flash ROM.
This method, however, needs a mask ROM, which stores at least an update program but is not used for normal operations. Accordingly, the employment of the mask ROM, which is not necessary at all during normal operations, increases the chip area of a control chip (control integrated circuit).